package com.ustc.hewei.snowflakemodule.segment.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ustc.hewei.snowflakemodule.exception.OptimisticKeyException;
import com.ustc.hewei.snowflakemodule.segment.entity.SegmentAlloc;

/**
 * @author hewei
 * @version 1.0
 * @description: TODO
 * @date 2022/11/16 14:40
 */

public interface ISegmentAllocService extends IService<SegmentAlloc> {
    SegmentAlloc updateMaxIdAndGetAlloc(String bizTag);

    SegmentAlloc updateMaxIdByNewStep(String bizTag, int step);

    SegmentAlloc updateMaxIdAndGetAllocWithOptimistic(String bizTag) throws OptimisticKeyException;

    SegmentAlloc updateMaxIdByNewStepWithOptimistic(String bizTag, int step) throws OptimisticKeyException;
}
